package com.example.study_thread.BaoZi;

public class Consumer implements Runnable { // 为true时进行生产
    private BaoZiPu baoZiPu;

    public Consumer(BaoZiPu baoZiPu) {
        this.baoZiPu = baoZiPu;
    }

    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(100L);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

           baoZiPu.getCount();
        }
    }
}
